-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[usdMaya] Clearing out the prim writers before saving the stage. #229
[usdMaya] Clearing out the prim writers before saving the stage. #229
Conversation
Filed as internal issue #147936. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing along more notes from our sets team, thanks!
@@ -348,11 +348,13 @@ void usdWriteJob::endJob() | |||
// prim for the export... usdVariantRootPrimPath | |||
mJobCtx.mStage->GetRootLayer()->SetDefaultPrim(defaultPrim); | |||
} | |||
// clear this so that no stage references are left around | |||
// and running code in destructors | |||
mJobCtx.mMayaPrimWriterList.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having an explicit hook would be preferred to doing stuff in a destructor here - I'd rather have an explicit call to some sort of "PostExport" callback (or virtual function on the MayaPrimWriter base class)
Signed-off-by: Pal Mezei <palm@lumapictures.com>
a13d3e5
to
ef86067
Compare
@sunyab sorry for the late reply, but I just got the PR updated. I added a separate postExport function that runs before saving the stage. |
[usdMaya] Clearing out the prim writers before saving the stage.
…/internal-only/feature/pipeline_adsk Re-Enable test TfSafeOutputFile
The change is super simple here; we are clearing the prim writers before saving the stage. This change is useful when somebody wants to run cleanup code in a primWriter's destruction. Otherwise, there is no way to track down the last write to get the same effect.
For example, we have been using feature successfully with some of our writers to optimize animation data before saving the stage.